package networkinstance;

public class Main3 {
    public static void main(String[] args) {
        try {
            java.net.URL u = new java.net.URL("http://127.0.0.1/test/test.html");
            java.net.URLConnection uc = u.openConnection();
            java.text.SimpleDateFormat ft = new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
            uc.setUseCaches(false);
            long timestamp = uc.getLastModified();
            System.out.println("test.html 文件最后修改时间 :" + ft.format(new java.util.Date(timestamp)));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
